<ion-header>
    <ion-navbar core-back-button>
        <ion-title><core-format-text [text]="title" contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId"></core-format-text></ion-title>

        <ion-buttons end>
            <button ion-button clear (click)="save()" [attr.aria-label]="'core.save' | translate">
                {{ 'core.save' | translate }}
            </button>
        </ion-buttons>
    </ion-navbar>
</ion-header>
<ion-content>
    <core-loading [hideUntil]="loaded">
        <form ion-list [formGroup]="pageForm">
            <ion-item text-wrap *ngIf="canEditTitle" class="item-title">
                <ion-input name="title" type="text" [placeholder]="'addon.mod_wiki.newpagetitle' | translate" [formControlName]="'title'"></ion-input>
            </ion-item>

            <ion-item>
                <core-rich-text-editor item-content [control]="contentControl" [placeholder]="'core.content' | translate" name="wiki_page_content" [component]="component" [componentId]="componentId"></core-rich-text-editor>
            </ion-item>

            <ion-item *ngIf="wrongVersionLock" text-center class="addon-mod_wiki-wrongversionlock" >
                <ion-badge color="danger" padding>{{ 'addon.mod_wiki.wrongversionlock' | translate }}</ion-badge>
            </ion-item>
        </form>
    </core-loading>
</ion-content>
